$import( "SmitearWebGL.Objects.Parser.Collada.DaeEntity" );

SmitearWebGL.Objects.Parser.Collada.DaeInput = SmitearWebGL.Objects.Parser.Collada.DaeEntity.extend(
{
	/******** constructor ********/

	init : function( document, node )
	{
		this.semantic = "";
		this.source = "";
		this.offset = 0;
		this.setId = 0;

		this._super( document, node );
		this._registClass( "SmitearWebGL.Objects.Parser.Collada.DaeInput" );
	}
	,
	read : function( node )
	{
		$THROW( node.localName == SmitearWebGL.Objects.Parser.Collada.Const.DAE_INPUT_ELEMENT,
		"expected a '" + SmitearWebGL.Objects.Parser.Collada.Const.DAE_INPUT_ELEMENT + "' element" );

		this._super( node );

		// required
		this.semantic = this.getAttribute( node, SmitearWebGL.Objects.Parser.Collada.Const.DAE_SEMANTIC_ATTRIBUTE );

		// required
		this.source = this.getAttribute( node, SmitearWebGL.Objects.Parser.Collada.Const.DAE_SOURCE_ATTRIBUTE );

		// optional
		this.offset = parseInt( this.getAttribute( node, SmitearWebGL.Objects.Parser.Collada.Const.DAE_OFFSET_ATTRIBUTE ), 10 );
		this.offset = this.offset ? this.offset : 0;

		// optional
		this.setId = parseInt( this.getAttribute( node, SmitearWebGL.Objects.Parser.Collada.Const.DAE_SET_ATTRIBUTE ), 10 );
	}
}
);